import { createStore, applyMiddleware } from "redux";
import thunkMiddleware from "redux-thunk";
import rootReducer from "./reducers";

// const arcgis_apiUrl = "/arcgis_js_api/library/4.12";
const arcgis_apiUrl = "https://js.arcgis.com/4.12";

const store = createStore(
    rootReducer,
    {
        mapConfig: {
            apiOption: {
                url: `${arcgis_apiUrl}/init.js`,
            },
            apiCssUrl: `${arcgis_apiUrl}/esri/css/main.css`,
            wkid: 3857,
        }
    },
    applyMiddleware(thunkMiddleware)
);

export default store;